
import java.io.StringReader;

import org.apache.xerces.dom.DocumentImpl;
import org.apache.xerces.xni.parser.XMLInputSource;

public class HoneyDocument extends DocumentImpl {

    private int count;

    public HoneyDocument() {
        super();
        count = 0;
    }

    public void write(String arg1) {
        System.out.println("\nwrite:" + arg1);
        // evaluate new input source
        count++;
        String systemId = "ABCScript" + count;
        XMLInputSource source = new XMLInputSource(null, systemId, null,
                new StringReader(arg1),
                "UTF-8");
        GlobalEnvironment.HtmlConf.evaluateInputSource(source);
    }

    public void writeln(String arg1) {
        String arg = arg1 + '\n';
        System.out.println("\nwriteln:" + arg1);
        // evaluate new input source
        count++;
        String systemId = "ABCScript" + count;
        XMLInputSource source = new XMLInputSource(null, systemId, null,
                new StringReader(arg),
                "UTF-8");
        GlobalEnvironment.HtmlConf.evaluateInputSource(source);
    }
}
